package com.jobsleaf.propertytester;

import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.services.IEvaluationService;

public class MyPropertyTester extends PropertyTester
{
	public boolean test(Object receiver, String property, Object[] args, Object expectedValue)
	{
		boolean state = false;
		try
		{
			IEvaluationService ws = (IEvaluationService) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(IEvaluationService.class);
			Integer integer = (Integer) ws.getCurrentState().getVariable("noOfRowsChecked");
			if (integer != null)
			{
				if (integer.intValue() > 0)
				{
					state = true;
				}
			}
		} catch (Exception e)
		{
			state = false;
		}

		return state;
	}
}
